str1 = 'zhangsan, lisi,wangwu,'

# 'a' 在str1 中出现的次数

print(str1.count('a'))


print(len(str1.split('a')) - 1)

count = 0
for i in str1:
    if 'a' == i:
        count += 1
print(count)
str1 = 'zhangsan, lisi,wangwu,'
# i = 0  --> len()-1
# count = 0

i = 0
count = 0
while i < len(str1)-1:
    if str1[i] == 'a':
        count += 1
    i += 1
print(count)


